package com.mvc.framework.util;

import java.math.BigDecimal;

public final class DoubleUtils {
	private DoubleUtils(){
	}
	
	public static Double toFixFraction(double in,int fractionDigit){
		BigDecimal  b = new BigDecimal(in);  
		return b.setScale(fractionDigit,BigDecimal.ROUND_HALF_UP).doubleValue();  
	}
	
	public static void main(String[] args) {
	    System.out.println(toFixFraction(3.156, 2));
    }
}
